package com.control.qct.businesssteward.activity;

import android.os.Bundle;
import android.support.v7.widget.SwitchCompat;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.TextView;

import com.control.qct.businesssteward.R;
import com.control.qct.businesssteward.base.BaseActivity;
import com.control.qct.businesssteward.utils.APKVersionCodeUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class AsInformationActivity extends BaseActivity {
    @BindView(R.id.tv_explain)
    TextView mTvExplain;
    @BindView(R.id.tv_version_name)
    TextView mTvVersionName;
    @BindView(R.id.sc_wifi)
    SwitchCompat mScWifi;

    private String mVersionName;

    public AsInformationActivity() {
        super(R.layout.activity_as_information);
    }

    @Override
    protected void initView() {
        setLeftIcon(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        setTitle("关于");
        mVersionName = APKVersionCodeUtils.getVerName(this);
        mTvVersionName.setText("版本号：" + mVersionName);
        mScWifi.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
                showShortToast(checked ? "自动下载已打开" : "自动关闭已关闭");
            }
        });
    }


    @OnClick({R.id.tv_check_update})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_check_update://检查更新
                showShortToast("当前版本已是最新版，无需更新！");
                break;
        }
    }
}
